UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+IYVSLwE2zK30BZMCj5HVNap0Cp2SgVs3NZFgcQj3E8='
WHERE
key_id = '1771c6c2514226a029406a677ac5db54a0f89d7dc49c8572a62af1b95b7f0878'
AND (
token = '+IYVSLwE2zK30BZMCj5HVNap0Cp2SgVs3NZFgcQj3E8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)