UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fl4mZs8Oi1qT3Tp6U1Ck9i+P72XPizdcqy2gurP1OyI='
WHERE
key_id = 'b5ff4ef49f05bc39a076e2a8038afe5608846477f5ac4ce62bcfe7ae5308367a'
AND (
token = 'fl4mZs8Oi1qT3Tp6U1Ck9i+P72XPizdcqy2gurP1OyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)