UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b/BcBr2sYwsMLiqLH2dztE38gANTQ1aOl566VY9rZMk='
WHERE
key_id = '0fb34437337ed1d6c4656040c0a414d118000f2f9425adec036c7be418a93ba6'
AND (
token = 'b/BcBr2sYwsMLiqLH2dztE38gANTQ1aOl566VY9rZMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)