UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FdokB103bUblech3gp1y29ohHLAdDMBcnLMfZNf8wMI=' 
WHERE 
  key_id = 'c55d61cab4726864c7e5eb6da484b2bc78d69cdd21032f616bbbedb2acf985c7' 
  AND (
    token = 'FdokB103bUblech3gp1y29ohHLAdDMBcnLMfZNf8wMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049