UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EFvQESnAq03NNyx8TPBfIEztzm4lfcT/5mTlQPKSMSE='
WHERE
key_id = '25c0da2eacaf6174d1cbfed4059cf4912c3072caaa2cd09cbc2595c3e2a719b9'
AND (
token = 'EFvQESnAq03NNyx8TPBfIEztzm4lfcT/5mTlQPKSMSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)