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

Query time 0.00020