UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x/wfMRFvy7OOqGrPDRCzqYEKOPDl/u+MCj4p+lPRp68=' 
WHERE 
  key_id = '4575a46cc079f9109f451df390989b953dd4bc7f453a7128dc666907ac6179b7' 
  AND (
    token = 'x/wfMRFvy7OOqGrPDRCzqYEKOPDl/u+MCj4p+lPRp68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031