UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nQKM/uEeoJo0PtkY/PxnUii76RwH7ecJWIpmrk/2b5A=' 
WHERE 
  key_id = '4735bb93e8abb008da3bccc2e69955a27fe1b39c9b33e8bd2b280d735ae3b1ef' 
  AND (
    token = 'nQKM/uEeoJo0PtkY/PxnUii76RwH7ecJWIpmrk/2b5A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060