UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OlxcNUEdLAwIIqdreub642s7k9O/cN/PHlGatfGq3lI=' 
WHERE 
  key_id = '952e92457913b0f5ed11fa2ddd8cc9276e768cb54725dec24bd2e41416a55fd1' 
  AND (
    token = 'OlxcNUEdLAwIIqdreub642s7k9O/cN/PHlGatfGq3lI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031