UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FoDrbYtKpv6eRecWI3N+ZXk6XeTv3GClne9aNcLpJLA=' 
WHERE 
  key_id = 'c47da238d1ccb7005a2445c67d76c8a21e183d5787d5aed8411712e4224066ab' 
  AND (
    token = 'FoDrbYtKpv6eRecWI3N+ZXk6XeTv3GClne9aNcLpJLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036