UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3oU6M2BDhUHeYG7rrySPG8sYHlKis1CGkNWZeU0r9sY=' 
WHERE 
  key_id = '2562686632017c981bf725f451b59181aa41eb3fb9951818e5e2b92ad6aa991d' 
  AND (
    token = '3oU6M2BDhUHeYG7rrySPG8sYHlKis1CGkNWZeU0r9sY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033