UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'REmfTQZxXDZhttSj/VAHMzlPJ7pSCaOEJIHA5xKhn3A=' 
WHERE 
  key_id = '299e50242443cc6e22c19c788269d3f498ba25a5f8f22180825acc10d12286aa' 
  AND (
    token = 'REmfTQZxXDZhttSj/VAHMzlPJ7pSCaOEJIHA5xKhn3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029