UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RGHQGBePRaTXql+eNBqlAs+rUA3j5wgxCzGXUY0FsS4='
WHERE
key_id = 'c5d0c374d81a3b2b32bd15e77889a5402a1c4c68859d64ad1a6528bed04cbbb2'
AND (
token = 'RGHQGBePRaTXql+eNBqlAs+rUA3j5wgxCzGXUY0FsS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)