UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eaU+N0VdL3WuJD38DdyroPx9ledCe3AJzhE7UKiIPMI=' 
WHERE 
  key_id = '107b89590fcf5499ddcbaf0d3066f89c72e388a6eaac66ad228e50c6620cda8c' 
  AND (
    token = 'eaU+N0VdL3WuJD38DdyroPx9ledCe3AJzhE7UKiIPMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032