UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QwZrytV9FQ4sC1p/Ps83WDktKZ4YYkJvH5FGqir3JfY=' 
WHERE 
  key_id = '6fc014e5898494b4ad4ac6e81948715eebba5ff4fe7e7c909d3db233f0312a64' 
  AND (
    token = 'QwZrytV9FQ4sC1p/Ps83WDktKZ4YYkJvH5FGqir3JfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031