UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3ywb39gsgZkUjfLqet2ow/8fIGomprmWesEuLgDJc7w=' 
WHERE 
  key_id = '87a546a6d504015fe22a3bbc6398c1d623f8a53dca585f78b86c914b87dc5af0' 
  AND (
    token = '3ywb39gsgZkUjfLqet2ow/8fIGomprmWesEuLgDJc7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020