UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jb991bKpVhm3gcgwGOBnSDQZl2Zms4o1r1WlQJNU4k0=' 
WHERE 
  key_id = '6a67dbb8fc4ac9a4c3b7d6432a711fba6f6c5e5798e8d6b24004fc9d0492e46a' 
  AND (
    token = 'jb991bKpVhm3gcgwGOBnSDQZl2Zms4o1r1WlQJNU4k0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032