UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/hhLzsY2sE9kv60eMAZW6Lqip2ehFIMmrq+hPFTek68=' 
WHERE 
  key_id = 'f0db36c523f0b4b27b0c61d9657280336e8c94380b93417d7d4536e345360f9f' 
  AND (
    token = '/hhLzsY2sE9kv60eMAZW6Lqip2ehFIMmrq+hPFTek68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028