UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lNS5G14bUCwKjB9osaYGeZeLt4Wp8UZtndd0Sa2f92I=' 
WHERE 
  key_id = '28cbdd3e58dfacfa81cfeb64ed19ffaa88fd3d32736407815122dd57a65de991' 
  AND (
    token = 'lNS5G14bUCwKjB9osaYGeZeLt4Wp8UZtndd0Sa2f92I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00088