UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gWqTYflonq/AkA6/zeN6gj1GLoc3nlogjFFXVijsm4c='
WHERE
key_id = 'b429f454dcbd43f92299df04e89c7ab152048dba800d6f054623d440d2491302'
AND (
token = 'gWqTYflonq/AkA6/zeN6gj1GLoc3nlogjFFXVijsm4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)