UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8e0c5CklNSiYhifdBJMN0F1yTmC4aZJxoWTPx/LhqgE=' 
WHERE 
  key_id = 'f36f272fa2d3191c6e19d6036b55b40eeecb385cc959417309363b846166d8f5' 
  AND (
    token = '8e0c5CklNSiYhifdBJMN0F1yTmC4aZJxoWTPx/LhqgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025