UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o4FzFwQhTuZ4QER4MbFccnM1uOKo48E7437ggu1m3qY='
WHERE
key_id = '346863a08dc6d54eeeca4a8e2590eb04deb44b58ae0781240bf59e376559370e'
AND (
token = 'o4FzFwQhTuZ4QER4MbFccnM1uOKo48E7437ggu1m3qY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)