UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9LvXSX6QfrzrbQi2qSYpqb5B75TJp5xVtCTxWbOOb08='
WHERE
key_id = '58a0bb57dba3cc440d7312d103228e9f25e9acf76a9325ea464ef4585c1b124e'
AND (
token = '9LvXSX6QfrzrbQi2qSYpqb5B75TJp5xVtCTxWbOOb08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)