UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '81jSZTN61YTN7oGoAT8hxcM0ISzuAoC85fFIxB3i8Ag=' 
WHERE 
  key_id = '507c2541c29ea377a0f09c86d8caedf48fefcb22d7a39b17b2f7d6b5e2dca26e' 
  AND (
    token = '81jSZTN61YTN7oGoAT8hxcM0ISzuAoC85fFIxB3i8Ag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046