UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HohupQ5DqjG5Ws/nsVGg3YC6XHJYiCX9d1DgImruFWE=' 
WHERE 
  key_id = '7469410356afce856f0f217ea6ced896b05a255ba3260e529cdc839fdd99f9b0' 
  AND (
    token = 'HohupQ5DqjG5Ws/nsVGg3YC6XHJYiCX9d1DgImruFWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032