UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4DbR+8QXSfPKmR83VhXtz6XnKOdUrDnuqf2taLywKsw='
WHERE
key_id = 'e70319e3c3fa49fe36757f1fd7327261dadb334ad186a18f5f9100fe71c5f19d'
AND (
token = '4DbR+8QXSfPKmR83VhXtz6XnKOdUrDnuqf2taLywKsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)