UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qMAdjOXTOODv1GEIRNhk+XiCnK1C6LMnzkFhnD58cXk=' 
WHERE 
  key_id = '8ab63bea30629a539e0bdc6616de00d3b4f28721f79487e64d542e2e61f1b65c' 
  AND (
    token = 'qMAdjOXTOODv1GEIRNhk+XiCnK1C6LMnzkFhnD58cXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043