UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yvUqkd/d+NXTBw8ntl6WrqWcJfSP5xQQStcmBtk4GpY='
WHERE
key_id = '8edc17a2c6c4282ef7a6921b874ae7352549bdf5a2b4469d4c0838ef5041d725'
AND (
token = 'yvUqkd/d+NXTBw8ntl6WrqWcJfSP5xQQStcmBtk4GpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)