UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pre5Zh4sM/2WlT0lFuyOHn8J8jtdVq0kPbxlC0zsL3k='
WHERE
key_id = '0c5f9ed73d4f7f218b7b8b8bfcb56694c5e655772223abef7e8e820fd5831bea'
AND (
token = 'Pre5Zh4sM/2WlT0lFuyOHn8J8jtdVq0kPbxlC0zsL3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)