UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '82bVU/WEim/+SAfrTSj0DgPl0BDwisBbujYfwtUBjls=' 
WHERE 
  key_id = '0b04b340586bcfa8925e7fd1f72afea486c45b806b4e3df6fc30c6932a792329' 
  AND (
    token = '82bVU/WEim/+SAfrTSj0DgPl0BDwisBbujYfwtUBjls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068