UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aakjT5mqbDUeXaNI85hvqmEcXSJrfCnuBVfZ7/njR4I=' 
WHERE 
  key_id = '3c5c96e43220f236e23efc2cf7583d0ee6cd1aba57bfac3cdb8f6cd54dd3d25d' 
  AND (
    token = 'aakjT5mqbDUeXaNI85hvqmEcXSJrfCnuBVfZ7/njR4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030