UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1fg1dqIxjeRwyKZ+59OE0vTxoTZuiPTBrldrqLJdZ1o='
WHERE
key_id = '9b343286c268d28ed3f570a17bff0e8d61fdd36d19440455d209a6c5eaf2450b'
AND (
token = '1fg1dqIxjeRwyKZ+59OE0vTxoTZuiPTBrldrqLJdZ1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)