UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u5sI1oi8x1F9ng5dbuxfnpd1In9JveLfanI14RKMeCE='
WHERE
key_id = '08c56f44203b9676a02a24aa5e041d68f124a4a46474d0bf7f0b6423b7f6f2e4'
AND (
token = 'u5sI1oi8x1F9ng5dbuxfnpd1In9JveLfanI14RKMeCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)