UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gmgg8sUzMFXW1fEmy47zoKjh9ZCk+Gkmyg+WPznv0oQ=' 
WHERE 
  key_id = '70cc7603fc337a18aa06d94a8b7b7d74879b301e0a36f8a038fcc200b29451ff' 
  AND (
    token = 'gmgg8sUzMFXW1fEmy47zoKjh9ZCk+Gkmyg+WPznv0oQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037