UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CP81/AOJHeAfEaCLkUGtYbkaCju01q8bto60T5ERNNw=' 
WHERE 
  key_id = '3b627a481e3b4a812ebc1a591a8c9ccd01339c976684c71a5283a3935c027317' 
  AND (
    token = 'CP81/AOJHeAfEaCLkUGtYbkaCju01q8bto60T5ERNNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029