UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AFoDTcT6c3JM3utA/OcSjJvbECTfqUrvCAAQSGNIHoA='
WHERE
key_id = '9fda338daec29568ad9b4e0b3d06f9d6e5b645c2ce342c851fdd68ba52251a1f'
AND (
token = 'AFoDTcT6c3JM3utA/OcSjJvbECTfqUrvCAAQSGNIHoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)