UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uVVAqAVUmOMW4zH3fEq2bUKxV2T04UWZrp8laIzstus=' 
WHERE 
  key_id = 'fc413372adf92b718f7001bd55246ab50df33c95a05b5b8fc0e50a804a28ecb1' 
  AND (
    token = 'uVVAqAVUmOMW4zH3fEq2bUKxV2T04UWZrp8laIzstus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052