UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QDQDkAr07ILfW8MDrp6k9O5ZIoE3D+3B8k8ap88ltJU=' 
WHERE 
  key_id = '1fee0e0c196f8c7d66b9a4c84bf4dc7c52bc10696926ccf14cde95892259369d' 
  AND (
    token = 'QDQDkAr07ILfW8MDrp6k9O5ZIoE3D+3B8k8ap88ltJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028