UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S9yzwNKXbBdmMfP6gXRJBBwJlNmQ8r+h28EjO1Aar1M='
WHERE
key_id = '636b8c6c92fb2180af74430fe2d540de4618fbecca4c1add9b38f42c2a22830e'
AND (
token = 'S9yzwNKXbBdmMfP6gXRJBBwJlNmQ8r+h28EjO1Aar1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)