UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZPIbnufhw1oUbRF4QGV5IQ1ITNUQxglZQ0U1x26AQdI='
WHERE
key_id = '740a1a8a94590ec384bbdb6015e1eb91bc0531d4c9baa073b3ac4c7b10654ea5'
AND (
token = 'ZPIbnufhw1oUbRF4QGV5IQ1ITNUQxglZQ0U1x26AQdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)