UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LInKCiGElxpPbQkAEDc/9VI//Y/XIq1WGdEc5A6xdIk=' 
WHERE 
  key_id = 'd2370ea79b11f7eae77f9387f83d4a9a0e11267ddf56a474da0b835b567cd2be' 
  AND (
    token = 'LInKCiGElxpPbQkAEDc/9VI//Y/XIq1WGdEc5A6xdIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030