UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x1ULeDzydkzu4EOw51rp+NqqYOgSCbntkMdM7g62Yjw=' 
WHERE 
  key_id = '630ec4fd44014fdbf56de57e76af5f187cade8e95968b010caa7d77ce3b8d92e' 
  AND (
    token = 'x1ULeDzydkzu4EOw51rp+NqqYOgSCbntkMdM7g62Yjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068