UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2hhtBJIpp/LuPQp0IPNR484wTw72yPrXSIKAg7wDPMA='
WHERE
key_id = '8706a07be56a8400b4f480472e141c8a32404f4cc5b5dad0330aebb155c2925a'
AND (
token = '2hhtBJIpp/LuPQp0IPNR484wTw72yPrXSIKAg7wDPMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)