UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ySLkP8K0lOCcMDa+zCNfnIx5rVhubDzsqNm8Nay0Tyk=' 
WHERE 
  key_id = 'f3bb1bd44db4327cace07d2f1e474e5f763234fb1411334672ce6fae8db8efe7' 
  AND (
    token = 'ySLkP8K0lOCcMDa+zCNfnIx5rVhubDzsqNm8Nay0Tyk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033