UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vAciVxEpFwiObpz5XTu8fGn1TGbMichVUo1vpfj2+uE=' 
WHERE 
  key_id = '08e6332caba330dd1dfdc8e903f4878621977990abc17e8013d5db8d9bce74d0' 
  AND (
    token = 'vAciVxEpFwiObpz5XTu8fGn1TGbMichVUo1vpfj2+uE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031