UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eeKK4Q30dwu4aTlL99yC21lz/qGPao2hD4NM7vH7MI8='
WHERE
key_id = '55f3e57bc22f577355971e3d09c44fc5317b898d393769f5b3a20941c3b92abe'
AND (
token = 'eeKK4Q30dwu4aTlL99yC21lz/qGPao2hD4NM7vH7MI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)