UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vITfb6FxnAj6eXoE23wkqEJDqcoiCKUTqTJvpjiW/vM=' 
WHERE 
  key_id = '411aebdbee3a0030c41fe8051857f70843d91b4b3f23013ca39943c9496f1a1b' 
  AND (
    token = 'vITfb6FxnAj6eXoE23wkqEJDqcoiCKUTqTJvpjiW/vM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031