UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mo6zvL1TI1LpJrCgr1F1Ec0dudbWBf+IeKRsAp/7O/k='
WHERE
key_id = 'b1d0a4b1d97927cc81e8b2a68e914e8de01970fe7f3ce9bc51ffd18c571d10a1'
AND (
token = 'Mo6zvL1TI1LpJrCgr1F1Ec0dudbWBf+IeKRsAp/7O/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)